package CloudDatabase.Project3.Group3.s12cs342;

import java.util.ArrayList;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import DataStructures.Project3.Group3.s12cs342.ScoreContainer;

import tools.Project3.Group3.s12cs342.CustomHttpClient;


public class WriteScore {
	
	static String url = "http://cs346.cs.uwosh.edu/students/gehrkp18/proj3cs342/writeBlob.php";
	
	public static void sendData(String name, ScoreContainer sc) {
		ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
		postParameters.add(new BasicNameValuePair("name", name));
		postParameters.add(new BasicNameValuePair("testID", ""+ sc.getTestID()));
		postParameters.add(new BasicNameValuePair("score", sc.getOutScore() + ""));

		try {
			CustomHttpClient.executeHttpPost(url, postParameters);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println(e);
		}
	}
}
